<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    

      <div>
       
        <label for="accounts1">    <input name="accounts" id="accounts1" class="accounts" type="radio" value="1">仅收回尾款，原坏账冲回； </label>
        </div>
        <div>
            <label for="accounts2">       <input name="accounts" type="radio" id="accounts2" class="accounts" value="2">收回款项，涉及开具发票/出具报告，原坏账冲回；</label>
 
        </div>
          <button onclick="fn1()">选择</button>
    <script>
  
      
  function  fn1(){
        let  accounts= document.querySelectorAll('.accounts')
        Array.from(accounts).forEach(item=>{
            if(item.checked){
                console.log(item.value,'选择那一项状态值');
            }
        })
  }


// var arr=[{age:10},{age:24},{age:43},{age:30},{age:60}]


//     arr.forEach(item=>{

//         if(item.age==10){
//             console.log(item.age,10);
//         }
//         if(item.age==24){
//             console.log(item.age,24);
//         }
//         if(item.age==43){
//             console.log(item.age,43);
//         }
//     })
//     arr.forEach(item=>{
//         if(item.age==10){
//             console.log(item.age,'10----');
//         }
//     })


    </script>
</body>
</html>